﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using Microsoft.ApplicationBlocks.Data;

using YouHP.Model;
using YouHP.IDAL;

namespace YouHP.SqlServerDAL
{
    public class AreaDAL : IArea
    {
        public List<AreaInfo> GetProvinceList()
        {
            IDataReader dr = SqlHelper.ExecuteReader(Common.ConnStr,
               Common.AreaSP_GetProvinceList) as IDataReader;

            return CBO.FillCollection<AreaInfo>(dr);
        }

        /*根据省id获得对应的城市列表*/
        public List<AreaInfo> GetAreaListByProvice(int provinceId)
        {
            IDataReader dr = SqlHelper.ExecuteReader(Common.ConnStr,
               Common.AreaSP_GetAreaListByProvice,
               provinceId) as IDataReader;

            return CBO.FillCollection<AreaInfo>(dr);
        }
    }
}
